//
//  BBTestMainViewController.m
//  BabyThermometer
//
//  Created by CaiLei on 10/14/14.
//  Copyright (c) 2014 baohu. All rights reserved.
//

#import "BBTestMainViewController.h"

@interface BBTestMainViewController () <UITextFieldDelegate>
@property (weak, nonatomic) IBOutlet UITextField *textField;

@end

@implementation BBTestMainViewController

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
    self.textField.delegate = self;
    [self.textField setTextAlignment:NSTextAlignmentCenter];
//    self.textField.contentVerticalAlignment = UIControlContentVerticalAlignmentTop;
//    [self.textField setTranslatesAutoresizingMaskIntoConstraints:NO];
//    self.textField.placeholder = @"Enter some text";
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

//-(void)textFieldDidBeginEditing:(UITextField *)textField
//{
//    //this removes your placeholder when textField get tapped
//    self.textField.placeholder = nil;
//    //this sets your cursor to the middle
//    self.textField.text = @" ";
//}
//
//-(void)textFieldDidEndEditing:(UITextField *)textField
//{
//    self.textField.placeholder = @"The placeholder text to use for this input field";
//}
//
//- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string
//{
//    NSString *proposedNewString = [[textField text] stringByReplacingCharactersInRange:range withString:string];
//    NSLog(@"propose: %@", proposedNewString);
//    
//    if ([proposedNewString isEqualToString:@""])
//    {
//        textField.text = [@" " stringByAppendingString:textField.text];
//    }
//    
//    return YES;
//}
@end
